package SingleNumber;



/**
 * 
 * @author Administrator
 * Given an array of integers, every element appears twice except for one. Find that single one.

 * Note:
 * Your algorithm should have a linear runtime complexity. Could you implement it without using extra memory?
 */
public class Solution {

	/**
	 * @param args
	 */
	public int singleNumber(int[] A) {
		for(int i=0;i<A.length-1;i++){
			A[0]=A[0]^A[i+1];
		}
	    return A[0]; 
	}
	public static void main(String[] args) {
		// TODO Auto-generated method stub
		int[] A={1,1,2,2,3};
		System.out.println(new Solution().singleNumber(A));
	}

}
